﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Common;
using Northwind.Domain;

namespace Ex01
{
    class Program
    {
        static void Main(string[] args)
        {
            var db = new  NorthwindEntities();
            Customer cust1 = db.Customers.OrderBy(c => c.Name).First();

            foreach (Purchase p in cust1.Purchases)
                Console.WriteLine(p.Price);

            // Retrieve the customer who made the lowest value purchase:

            Purchase cheapest = db.Purchases.OrderBy(p => p.Price).First();
            cheapest.Customer.Dump();
        }
    }
}
